<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" href="http://code.jquery.com/mobile/1.3.2/jquery.mobile-1.3.2.min.css">
    <script src="http://code.jquery.com/jquery-1.8.3.min.js"></script>
    <script src="http://code.jquery.com/mobile/1.3.2/jquery.mobile-1.3.2.min.js"></script>
    <title>领取优惠券</title>
</head>
<body>
<div data-role="page" data-theme="e">

    <div data-role="header" data-theme="e">
        <h1 >欢迎领取优惠券</h1>
    </div>
        <label for="number" >领取优惠券到我的账户:</label>
        <input type="text" name="telephone" id="number" placeholder="请输入您的手机号"/>
        <input type="button" id = "getCoupon" value="领取" data-theme="b"/>

    <!--<div data-role="footer" data-theme="d">
      <h1>页脚文本</h1>
    </div>-->

</div>

<script>
    $("#getCoupon").on("click",function () {
        var telephone = $("#number").val();
        $.ajax({
            type : "post",
            url : "getCoupon",
            data : {"telephone":telephone},
            dataType:"json",
            success : function (result) {
                alert(result.info);
            },
            error: function(XMLHttpRequest, textStatus, errorThrown) {
                alert("服务异常,请稍后你再试！")
            },
        })
    })

</script>
</body>
</html>